package com.xiaobange.entity;


import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 权限表
 * @TableName sys_permission
 */
@Data
public class Permission implements Serializable {
    /**
     * 权限ID
     */
    private Integer persId;

    /**
     * 权限标识符
     */
    private String persKey;

    /**
     * 权限名称
     */
    private String persName;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 备注
     */
    private String remark;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Permission other = (Permission) that;
        return (this.getPersId() == null ? other.getPersId() == null : this.getPersId().equals(other.getPersId()))
            && (this.getPersKey() == null ? other.getPersKey() == null : this.getPersKey().equals(other.getPersKey()))
            && (this.getPersName() == null ? other.getPersName() == null : this.getPersName().equals(other.getPersName()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPersId() == null) ? 0 : getPersId().hashCode());
        result = prime * result + ((getPersKey() == null) ? 0 : getPersKey().hashCode());
        result = prime * result + ((getPersName() == null) ? 0 : getPersName().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", persId=").append(persId);
        sb.append(", persKey=").append(persKey);
        sb.append(", persName=").append(persName);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}